package com.zhuss.controller.meeting;

import com.zhuss.bean.bo.meeting.apply.CheckApplyBo;
import com.zhuss.bean.bo.meeting.room.DetailRoomBo;
import com.zhuss.bean.bo.meeting.room.SearchRoomBo;
import com.zhuss.common.AbstractBo;
import com.zhuss.common.BaseController;
import com.zhuss.common.ReadService;
import com.zhuss.exception.WpsException;
import com.zhuss.meeting.room.RoomReadServiceExt;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: zhushanshuo
 * @Date: 2020/2/12 21:32
 */
@RestController
@RequestMapping("/room")
public class RoomReadController extends BaseController{

    @Autowired
    @Qualifier("roomReadService")
    private ReadService<Object, Object> roomReadService;

    @Autowired
    @Qualifier("roomReadServiceExt")
    private RoomReadServiceExt roomReadServiceExt;

    /**
     * 列表
     * @param bo
     * @return
     * @throws WpsException
     */
    @ResponseBody
    @RequestMapping("/list")
    public Object list(@RequestBody SearchRoomBo bo) throws WpsException {
        Object result = roomReadService.list(bo);
        return result;
    }

    /**
     * 详情
     * @param bo
     * @return
     * @throws WpsException
     */
    @ResponseBody
    @RequestMapping("/detail")
    public Object detail(@RequestBody DetailRoomBo bo) throws WpsException {

        Object result = roomReadService.detail(bo);
        return result;
    }

    /**
     * 获取可分配会议室
     * @param bo
     * @return
     * @throws WpsException
     */
    @ResponseBody
    @RequestMapping("/check")
    public Object check(@RequestBody CheckApplyBo bo) throws WpsException {
        Object result = roomReadServiceExt.check(bo);
        return result;
    }

    /**
     * 获取会议室装配
     */
    @ResponseBody
    @RequestMapping("/getRoomDeviceList")
    public Object getRoomDevice(@RequestBody AbstractBo bo) throws WpsException {
        return roomReadServiceExt.getRoomDevice(bo);
    }

}
